home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1986 April
/
1986-04.d64
/
dir filer
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
155 lines
10 n$="zz":poke53281,0:poke53280,0:nr=214:nc=211:kb=198:poke808,225
20 goto470
30 pokenr,1:print:print"[159]are you sure? (y/n)"
40 pokekb,0
50 getk$:ifk$=""then50
60 pokekb,0:return
70 gosub100:pokenr,1:print:print"[159]*** working **** ":return
80 pokenr,1:print"[159]":printmid$(m$,4,16):return
90 m$="":pokenr,1:print:print" ":gosub120:return
100 pokenr,rl+2:print:printtab(cl*20);"[158]"mid$(n$(rl+(i+1)*cl+d-1),4,16)
110 return
120 pokenr,r+2:print:printtab(c*20);"[159]";mid$(n$(r+(i+1)*c+d-1),4,16)
130 return
140 print"[147][158]"he$;
150 ifd>1thenpokenc,21:print" p = prior screen "
160 ifd=<n-40thenpokenc,21:print" n = next screen "
170 i=int((n-d-1)/2+.5):ifi>19theni=19
180 gosub80:pokenr,3:print"[158]"
190 forx=dtod+i
200 printmid$(n$(x),4,16)",";
210 printt$(asc(n$(x))andnot248);
220 if(asc(n$(x))and64)=64thenprint"<";
230 ifasc(n$(x+i+1)+chr$(0))=0then280
240 printtab(20);mid$(n$(x+i+1),4,16)",";
250 printt$(asc(n$(x+i+1))andnot248);
260 if(asc(n$(x+i+1))and64)=64thenprint"<";
270 print
280 next:ifr>ithenr=i+1
285 ifr>ithenr=i
290 gosub120:return
300 gosub40:cl=c:rl=r
310 ifk$=chr$(13)ork$="[133]"ork$="-"ork$=","ork$=" "ork$=""thenreturn
320 ifk$=""thenr=1:c=0
330 ifk$=""ork$="[157]"thenc=notcand1
340 ifk$=""ork$="[145]"thenr=(r+1+2*(k$>""))
350 ifc>n-1thenr=1:c=0
360 ifr>i+1thenr=1
370 ifr<1thenr=i+1
380 ifn$(r+(i+1)*c+d-1)=""then330
390 if(cl<>c)or(rl<>r)thengosub100:gosub120
400 ifk$="p"andd>1thend=d-40:gosub140
410 ifk$="n"andd=<n-40thend=d+40:gosub140
420 goto300
430 pokenr,7:print:print" [158]are you sure? (y/n) "
440 gosub40:ifk$="y"then1440
450 ifk$=""then440
460 return
470 print"[147][159][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]
480 [153]"peek sysdirectory fileropen peek"
490 [153]"peek peek"
500 [153]"peek sysinsert diskette in driveopen peek"
510 [153]"mid$tantantantantantantantantantantantantantantantantantantantantantantantantantan(NULL)
520 forx=1to6:n$=n$+n$:next
530 n$=mid$(n$,2):n$=n$+n$
540 forx=828to861
550 ready:pokex,y:next
560 forx=1to30:z$=z$+chr$(0):next
570 dimn$(144),s(18),t$(4):d=1:n=0:f=0:b=1:r=1:c=0
580 forx=0to17:ready:s(x)=y:next
590 t$(1)="s":t$(2)="p":t$(3)="u":t$(4)="r"
600 ln$=chr$(130)+chr$(18)+chr$(18)+"----------------"+left$(z$,11)
610 print"[213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]"
620 print"[194] [158]press return[146] to continue[159] [194]"
630 print"[202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
640 gosub40:ifk$=""thengosub430
650 pokenr,7:print:print" [158]reading disk name "
660 open15,8,15,"i0":open1,8,3,"$"
670 sys828:input#15,en$,em$:ifen$="00"then710
680 pokenr,7:print
690 print" [158]disk read error # "en$" "
700 print:goto1480
710 he$=mid$(n$,143,16)+","+mid$(n$,161,2)
720 pokenr,3:print:print" "he$" "
730 pokenr,7:print:print" reading entry #"n" "
740 sys828:forx=1to254step32:y=asc(mid$(n$,x,1))and127
750 ify=0then770
760 n=n+1:n$(n)=mid$(n$,x,30)
770 pokenr,7:print:pokenc,20:printn
780 next
790 ifst=0then730
800 print"[145] total entries ="
810 forx=1to1500:next
820 close1
830 m$="":gosub140
840 gosub300:f=r+(i+1)*c+d-1
850 ifk$="-"then990
860 ifk$=" "andn>1then1040
870 ifk$=","then1120
880 ifk$=""then1190
890 ifk$="[133]"then1230
900 m$=n$(f):gosub80
910 gosub300:t=r+(i+1)*c+d-1
920 iff=t-1orf=tthengosub90:goto840
930 gosub70
940 iff>tthenv=-1
950 iff<tthenv=1:t=t-1
960 n$(f)=n$(f+v):f=f+v:iff<>tthen960
970 n$(t)=m$
980 goto830
990 gosub70:b=0
1000 n=n+1:forx=ntof+1step-1
1010 n$(x)=n$(x-1):next
1020 n$(f)=ln$
1030 goto830
1040 gosub30:ifk$<>"y"thengosub90:goto840
1050 gosub70:b=0
1060 n=n-1:forx=fton
1070 n$(x)=n$(x+1):next
1080 n$(n+1)=""
1090 ifn<c+1thenc=0
1100 iff=n+1thenr=r+(r>1)
1110 goto830
1120 a=asc(n$(f))
1130 ifa=130thena=194:goto1150
1140 ifa=194thena=130
1150 n$(f)=chr$(a)+right$(n$(f),29)
1160 pokenr,rl+2:print:printtab(cl*20+18);
1170 print"[158]"chr$(-60*(a=194));chr$(-32*(a=130))
1180 goto840
1190 gosub100
1200 gosub30:ifk$="y"then1440
1210 ifk$=""then1200
1220 gosub90:goto840
1230 gosub100:gosub30:ifk$<>"y"thengosub90:goto840
1240 pokenr,1:print:print"[159]writing directory "
1250 ifn/8=int(n/8)then1270
1260 n=n+1:n$(n)=z$:goto1250
1270 s=0:t=18:s(n/8+.5)=255:n=1:open2,8,2,"#"
1280 ifs(s+1)=255thent=0
1290 print#15,"b-p";2;0
1300 print#2,chr$(t);chr$(s(s+1));:p=2
1310 forx=nton+7:print#15,"b-p";2;p
1320 print#2,n$(x);:p=p+32:next:n=x
1330 print#15,"u2";2;0;18;s(s):input#15,en$,em$:ifen$="00"then1370
1340 pokenr,1:print
1350 print"[159] disk write error # "en$
1360 fort=1to2000:next:goto1440
1370 s=s+1:ifs(s)<>255goto1280
1380 ifbthen1410
1390 print#2,chr$(0);chr$(255);z$:print#15,"u2";2;0;18;18
1400 pokenr,1:print:print"[159]validating bam ":print#15,"v0"
1410 close2:print#15,"i0":close15
1420 pokenr,1:print:print"[159]another disk? (y/n)"
1430 gosub40:ifk$="y"thenrun
1440 print"[147]":pokenr,7:print
1450 print"[159][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]"
1460 print"[194] [158]program terminated [159][194]"
1470 print"[202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
1480 close1:close2:close15
1490 sys 65418
1500 data 160,2,177,45,153,137,0,200,192,6,208,246,162
1510 data 1,32,198,255,32,228,255,164,142,145,140,200
1520 data 132,142,196,139,208,242,76,204,255
1530 data 1,4,7,10,13,16,2,5,8,11,14,17,3,6,9,12,15,18